package com.zhangshuo.patternDesign.command;

/**
 * Created by shuo.zhang on 2017-10-23.
 */
public class Salesman {

    private String name;

    public Salesman(String name) {
        super();
        this.name = name;
    }


    public String getName() {
        return name;
    }


    public void putDemand(ProjectManager projectManager){
        System.out.println("业务员" + name + "提出新需求");
        projectManager.receiveTask(new DemandTask());
    }

    public void putBug(ProjectManager projectManager){
        System.out.println("业务员" + name + "提出Bug");
        projectManager.receiveTask(new BugTask());
    }

    public void putProblem(ProjectManager projectManager){
        System.out.println("业务员" + name + "提出问题");
        projectManager.receiveTask(new ProblemTask());
    }
    /**
     * 以下就不要给程序员直接下命令，先找项目经理去吧
     * @param programmer
     */
    public void putDemand(Programmer programmer){
        System.out.println("业务员" + name + "提出新需求");
        programmer.handleDemand();
    }

    public void putBug(Programmer programmer){
        System.out.println("业务员" + name + "提出Bug");
        programmer.handleBug();
    }

    public void putProblem(Programmer programmer){
        System.out.println("业务员" + name + "提出问题");
        programmer.handleProblem();
    }


}
